//引入模块
const express = require('express');
const body_parser = require('body-parser');

//引入路由
const routerAdmin = require('./router/admin');
const routerUser = require('./router/user');
const routerPro = require('./router/product');

//启动服务器
const app = express();
app.listen(8080);

//引入静态文件
app.use(express.static('./public'));

//执行body-parser解析数据
app.use(body_parser.urlencoded({
    extended:false
}));

//挂载
app.use('/admin',routerAdmin);
app.use('/user',routerUser);
app.use('/pro',routerPro);